package com.study.zk.lock.simple;

/**
 * 多个order服务实例，多个订单生成器实例（场景）
 *
 * @author: chenhs
 * @date: Created in 6:34 2020/2/4
 **/
public class OrderServiceImpl implements OrderService {

    private OrderCodeGenerator ocg = new OrderCodeGenerator();

    @Override
    public void createOrder() {

        String orderCode = ocg.getOrderCode();

        System.out.println(Thread.currentThread().getName() + "================>" + orderCode);
        //...业务代码，此处省略100行代码
    }
}
